---
export interface Props {
  href?: string;
  openInNewTab?: boolean;
  rounded?: "full" | "md" | "none";
  variant?: "primary" | "secondary";
  specialHover?: boolean;
  className?: string;
  download?: string | false;
}

const {
  href = "",
  rounded = "md",
  variant = "primary",
  openInNewTab = false,
  className = "",
  specialHover = false,
  download = false,
} = Astro.props;

const roundedClass =
  rounded === "full" ? "rounded-full" : rounded === "md" ? "rounded-md" : "";
const variantClass =
  variant === "primary"
    ? "bg-t3-purple-100 hover:bg-t3-purple-200 text-slate-800"
    : "bg-white/10 hover:bg-white/20 text-white";

const specialHoverClass = specialHover
  ? "hover:shadow hover:shadow-[#300171] duration-500"
  : "";
---

<a
  href={href}
  target={openInNewTab ? "_blank" : "_self"}
  rel="noopener noreferrer"
  class={`${specialHoverClass} ${roundedClass} ${variantClass} ${className} inline-flex items-center px-3 lg:px-4 lg:py-3 md:px-5 py-2 text-sm md:text-base font-semibold cursor-pointer hover:no-underline transition-colors`}
  {...download ? { download } : {}}
>
  <slot />
</a>
